package com.zelin.dao.staticproxy;

import com.zelin.dao.UserDao;
import com.zelin.dao.impl.UserDaoImpl;

public class UserDaoStaticProxyImpl implements UserDao {
    //引入目标对象
    private  UserDao userDao;
    public UserDaoStaticProxyImpl(){
        userDao =new UserDaoImpl();
    }
    @Override
    public void add() {
        userDao.add();
    }

    @Override
    public void update() {
        userDao.update();
    }

    @Override
    public void delete() {
        userDao.delete();
    }

    @Override
    public void query() {
        checkSecurity();
        userDao.query();
    }

    private void checkSecurity() {
        System.out.println("正在进行安全性检查----");
    }
}
